
import { getCategory } from "@/api/category";
export default {
    namespaced: true,
    state: () => ({
        categorys: []
    }),
    mutations: {
        setCategorys(state, data) {
            state.categorys = data
        }
    },
    actions: {
        async useCategorysData(context) {
            return new Promise(async (resolve, reject) => {
                const res = await getCategory()
                context.commit('setCategorys', res)
                resolve(res)
            })

        }
    }
}